package com.woniuxy01;

import java.util.Scanner;

public class Test01 {
    public static void main(String[] args) {
//        int i=1,sum=0;
//        while(i<=100){
//            sum=sum+i;
//            i++;
//        }
//        System.out.println(i);
//        System.out.println(sum);

        Scanner scanner=new Scanner(System.in);

        int sum=0;
        for(int i=1;i<=100;i++){
            sum+=i;
        }
        System.out.println(sum);


//        System.out.println("是否开始游戏y/n");
//        String answer = scanner.next();
//        while("y".equals(answer)){
//            System.out.println("玩一把");
//            System.out.println("是否继续游戏y/n");
//            answer = scanner.next();
//        }
        System.out.println("是否开始游戏y/n");
        for(String answer = scanner.next();"y".equals(answer);answer = scanner.next()){
            System.out.println("玩一把");
            System.out.println("是否继续游戏y/n");
        }
    }
}
